<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="../node_modules/vue/dist/vue.js"></script>
  <div id="app">
    {{fullName}}
  </div>
  <script>
    new Vue({
      el:"#app",
      data:{
        firstName:'Wang',
        lastName:'ZhiYuan'
      },
      computed:{
        //完整的写法
        fullName:{
          set(val){
            //一般不设置set方法，计算属性最好是只读的，不要设置set方法
            console.log(val);
          },
          get(){
            return this.firstName+this.lastName
          }
        }
      }
    })
  </script>
</body>
</html>